<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    	<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>登陆</title>
		<style type="text/css">
			html{ font-size: 62.5%; }
			body{font-family: 'Microsoft YaHei','Lantinghei SC','Open Sans',Arial,'Hiragino Sans GB','STHeiti','WenQuanYi Micro Hei','SimSun',sans-serif;font-size: 1.5rem; margin: 0; color: #4A4A4A;background-color: #f5f5f5;}
			/*.fh img{padding-left: 4%;padding-top: 2%;}*/
			.logo{text-align:center;}
			.logo img{margin: 0 auto;margin-top: 60px;width: 9rem;}
			.logo p{text-align: center;font-size: 2rem;font-weight: 600;color: #000;letter-spacing:3px}
			.tj{width:90%; margin-left:5%; margin-right:5%;}
			.tj1{border-bottom: 1px solid #999;line-height: 60px;}
			.tj1 .img1{vertical-align: middle; width:2rem; vertical-align: middle;}
			.tj1 .img2{vertical-align: middle; width:2.5rem; height:2.5rem;}
			.width70{width:70%;}
			 input{padding-left:1rem;font-size: 1.5rem;height: 50px;border: none;outline:none;width: 50%;background-color: #f5f5f5;}
		</style>
		 <script src="/public/reg/js/jquery.js"></script>
		 <script src="/public/js/layer/layer.js"></script>
	</head>
	<body>
		<!--<div class="fh">
			<a href="#"><img src="/public/reg/images/1.png"/></a>
		</div>-->
		<div class="logo">
			<img src="/public/reg/images/2.png"/>
			<p>富通应用</p>
		</div>
		<div class="tj">
				<div class="tj1">
					<img class="img1" src="/public/reg/images/3.png"/>
					<input type="text" value="" class="none width70" placeholder="请输入手机号码"/>
					<img src="/public/reg/images/3-1.png" style="width: 2.5rem; height: 2.5rem; vertical-align: middle;"  class="img1" onclick="qingKong()"/>
				</div>
			<div class="tj1">	
				<img  class="img1" src="/public/reg/images/4.png"/>
				<input type="text" value="" placeholder="请输入验证码" style="width: 50%;" id="code"/>
				<input type="button" style="color: #3fb4fa;border: none;width:33%;text-indent:0;background: none;" value="获取验证码" class="qihuan" onclick="sendCode(this)">
			</div>
			<div class="tj1">	
				<img class="img1" src="/public/reg/images/5.png"/>
				<input type="password" value="" placeholder="请输入密码" class="mima width70"/>
				<img src="/public/reg/images/6.png" onclick="shuxing()" class="pic" style="width: 2.5rem;height:1rem;"/>
			</div>
			<div class="tj1">	
				<img class="img1" src="/public/reg/images/5.png"/>
				<input type="password" value="" class="width70" placeholder="确认密码" id="qrpass"/>
			</div>
			<div class="tj1">
				<img class="img1" src="/public/reg/images/t.png" />
				<input type="text" value="{$name}" placeholder="推荐人" style="width:60%;" id="person"/>
			</div>
			<div style="text-align:center;">
				<input type="button" onclick="sub()" value="提 交" style="background: #3fb4fa;height: 5rem;margin-top: 8rem;border-radius: 50px;color: #fff;width: 70%; font-size:2rem; text-align:center;padding-left:0;"/>
			</div>
			<div style="margin-top: 3rem;margin-bottom: 3rem;text-align:center;">
				<a href="{:url('Login/ewm')}" style="text-decoration: none;font-size: 1.5rem;font-weight: 500;color: #888;letter-spacing:2px">已有账号,去登陆</a>
			</div>
				
		
		</div>
	</body>
	<script type="text/javascript"> 
		
		function qingKong(){
			$('.none').val("");
			
		}
//		function miaojian(){
//			console.log($('.qihuan').val())
//			var inner = parseInt($('.qihuan').val());
//			inner--;
//			$('.qihuan').val(inner);
//		}
		
var clock = '';
var nums = 60;
var btn;
   function sendCode(thisBtn){
   var phone =  $('.none').val();
   	if(phone == '' || !/^1[3|4|5|7|8][0-9]\d{8}$/.test(phone)){
   		layer.msg("请输入正确的手机号码");
		return;
	}else{
   		btn = thisBtn;
		btn.disabled = true; //将按钮置为不可点击
		btn.value = nums;
		clock = setInterval(doLoop, 1000); //一秒执行一次	
   	}
	//调用发送验证码接口
	var url = 'http://123.jufupt.com/wallet/Register/smsSend';
	$.post(url,{phone:phone},
		function(d){
			 layer.msg(d.msg);
		});
	
   }
   function doLoop(){
   	nums--;
	 if(nums > 0){
	  	btn.value = nums;
	 }else{
		  clearInterval(clock); //清除js定时器
		  btn.disabled = false;
		  btn.value = '点击发送验证码';
		  nums = 60; //重置时间
	 }
   }
   
   function shuxing(){
   		if($(".mima").attr('type') == 'password'){
   			$(".mima").attr('type','text');
   			$(".pic").attr('src','/public/reg/images/icon_show.png');
   		}else{
   			$(".mima").attr('type','password');
   			$(".pic").attr('src','/public/reg/images/6.png');
   		}
   }
	</script> 
	<script>
	function sub(){
		var url = 'http://123.jufupt.com/wallet/Register/register';
		var phone = $('.none').val();
		var code = $('#code').val();
		var pass = $('#qrpass').val();
		var tuijian = $('#person').val();
		$.post(url,{phone:phone,code:code,pass:pass,tuijian:tuijian},function(d){
			if(d.code==1){
				layer.msg(d.msg);
				setTimeout(function(){
					window.location.href="{:url('Login/ewm')}";
				},300);
			}else{
				 layer.msg(d.msg);
			}
		});
	
	}
	
	</script>
</html>
